3.93 \(\int \frac {(2-3 x+x^2) (d+e x+f x^2)}{(4-5 x^2+x^4)^2} \, dx\)

Optimal. Leaf size=105 \[ -\frac {x (3 d-4 e+6 f)+5 d-6 e+8 f}{12 \left (x^2+3 x+2\right )}-\frac {1}{36} \log (1-x) (d+e+f)+\frac {1}{144} \log (2-x) (d+2 e+4 f)-\frac {1}{36} \log (x+1) (7 d-13 e+19 f)+\frac {1}{144} \log (x+2) (31 d-50 e+76 f) \]

[Out]

1/12*(-5*d+6*e-8*f-(3*d-4*e+6*f)*x)/(x^2+3*x+2)-1/36*(d+e+f)*ln(1-x)+1/144*(d+2*e+4*f)*ln(2-x)-1/36*(7*d-13*e+
19*f)*ln(1+x)+1/144*(31*d-50*e+76*f)*ln(2+x)

________________________________________________________________________________________

Rubi [A]  time = 0.32, antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {1586, 1060, 1072, 632, 31} \[ -\frac {x (3 d-4 e+6 f)+5 d-6 e+8 f}{12 \left (x^2+3 x+2\right )}-\frac {1}{36} \log (1-x) (d+e+f)+\frac {1}{144} \log (2-x) (d+2 e+4 f)-\frac {1}{36} \log (x+1) (7 d-13 e+19 f)+\frac {1}{144} \log (x+2) (31 d-50 e+76 f) \]

Antiderivative was successfully verified.

[In]

Int[((2 - 3*x + x^2)*(d + e*x + f*x^2))/(4 - 5*x^2 + x^4)^2,x]

[Out]

-(5*d - 6*e + 8*f + (3*d - 4*e + 6*f)*x)/(12*(2 + 3*x + x^2)) - ((d + e + f)*Log[1 - x])/36 + ((d + 2*e + 4*f)
*Log[2 - x])/144 - ((7*d - 13*e + 19*f)*Log[1 + x])/36 + ((31*d - 50*e + 76*f)*Log[2 + x])/144

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 632

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[
(c*d - e*(b/2 - q/2))/q, Int[1/(b/2 - q/2 + c*x), x], x] - Dist[(c*d - e*(b/2 + q/2))/q, Int[1/(b/2 + q/2 + c*
x), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] && NiceSqrtQ[b^2 - 4*a*
c]

Rule 1060

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_)*((A_.) + (B_.)*(x_) + (C_.)*(x_)^2)*((d_) + (e_.)*(x_) + (f_.)*(x_
)^2)^(q_), x_Symbol] :> Simp[((a + b*x + c*x^2)^(p + 1)*(d + e*x + f*x^2)^(q + 1)*((A*c - a*C)*(2*a*c*e - b*(c
*d + a*f)) + (A*b - a*B)*(2*c^2*d + b^2*f - c*(b*e + 2*a*f)) + c*(A*(2*c^2*d + b^2*f - c*(b*e + 2*a*f)) - B*(b
*c*d - 2*a*c*e + a*b*f) + C*(b^2*d - a*b*e - 2*a*(c*d - a*f)))*x))/((b^2 - 4*a*c)*((c*d - a*f)^2 - (b*d - a*e)
*(c*e - b*f))*(p + 1)), x] + Dist[1/((b^2 - 4*a*c)*((c*d - a*f)^2 - (b*d - a*e)*(c*e - b*f))*(p + 1)), Int[(a
+ b*x + c*x^2)^(p + 1)*(d + e*x + f*x^2)^q*Simp[(b*B - 2*A*c - 2*a*C)*((c*d - a*f)^2 - (b*d - a*e)*(c*e - b*f)
)*(p + 1) + (b^2*(C*d + A*f) - b*(B*c*d + A*c*e + a*C*e + a*B*f) + 2*(A*c*(c*d - a*f) - a*(c*C*d - B*c*e - a*C
*f)))*(a*f*(p + 1) - c*d*(p + 2)) - e*((A*c - a*C)*(2*a*c*e - b*(c*d + a*f)) + (A*b - a*B)*(2*c^2*d + b^2*f -
c*(b*e + 2*a*f)))*(p + q + 2) - (2*f*((A*c - a*C)*(2*a*c*e - b*(c*d + a*f)) + (A*b - a*B)*(2*c^2*d + b^2*f - c
*(b*e + 2*a*f)))*(p + q + 2) - (b^2*(C*d + A*f) - b*(B*c*d + A*c*e + a*C*e + a*B*f) + 2*(A*c*(c*d - a*f) - a*(
c*C*d - B*c*e - a*C*f)))*(b*f*(p + 1) - c*e*(2*p + q + 4)))*x - c*f*(b^2*(C*d + A*f) - b*(B*c*d + A*c*e + a*C*
e + a*B*f) + 2*(A*c*(c*d - a*f) - a*(c*C*d - B*c*e - a*C*f)))*(2*p + 2*q + 5)*x^2, x], x], x] /; FreeQ[{a, b,
c, d, e, f, A, B, C, q}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[e^2 - 4*d*f, 0] && LtQ[p, -1] && NeQ[(c*d - a*f)^2 -
 (b*d - a*e)*(c*e - b*f), 0] &&  !( !IntegerQ[p] && ILtQ[q, -1]) &&  !IGtQ[q, 0]

Rule 1072

Int[((A_.) + (B_.)*(x_) + (C_.)*(x_)^2)/(((a_) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_) + (e_.)*(x_) + (f_.)*(x_)^2)
), x_Symbol] :> With[{q = c^2*d^2 - b*c*d*e + a*c*e^2 + b^2*d*f - 2*a*c*d*f - a*b*e*f + a^2*f^2}, Dist[1/q, In
t[(A*c^2*d - a*c*C*d - A*b*c*e + a*B*c*e + A*b^2*f - a*b*B*f - a*A*c*f + a^2*C*f + c*(B*c*d - b*C*d - A*c*e +
a*C*e + A*b*f - a*B*f)*x)/(a + b*x + c*x^2), x], x] + Dist[1/q, Int[(c*C*d^2 - B*c*d*e + A*c*e^2 + b*B*d*f - A
*c*d*f - a*C*d*f - A*b*e*f + a*A*f^2 - f*(B*c*d - b*C*d - A*c*e + a*C*e + A*b*f - a*B*f)*x)/(d + e*x + f*x^2),
 x], x] /; NeQ[q, 0]] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[e^2 - 4*d*f, 0]

Rule 1586

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rubi steps

\begin {align*} \int \frac {\left (2-3 x+x^2\right ) \left (d+e x+f x^2\right )}{\left (4-5 x^2+x^4\right )^2} \, dx &=\int \frac {d+e x+f x^2}{\left (2-3 x+x^2\right ) \left (2+3 x+x^2\right )^2} \, dx\\ &=-\frac {5 d-6 e+8 f+(3 d-4 e+6 f) x}{12 \left (2+3 x+x^2\right )}-\frac {1}{72} \int \frac {6 (3 d-10 e+12 f)-24 (2 d-3 e+5 f) x+6 (3 d-4 e+6 f) x^2}{\left (2-3 x+x^2\right ) \left (2+3 x+x^2\right )} \, dx\\ &=-\frac {5 d-6 e+8 f+(3 d-4 e+6 f) x}{12 \left (2+3 x+x^2\right )}-\frac {\int \frac {-288 (2 d-3 e+5 f)+108 (3 d-10 e+12 f)+(72 (3 d-4 e+6 f)-36 (3 d-10 e+12 f)) x}{2-3 x+x^2} \, dx}{5184}-\frac {\int \frac {288 (2 d-3 e+5 f)+108 (3 d-10 e+12 f)-(72 (3 d-4 e+6 f)-36 (3 d-10 e+12 f)) x}{2+3 x+x^2} \, dx}{5184}\\ &=-\frac {5 d-6 e+8 f+(3 d-4 e+6 f) x}{12 \left (2+3 x+x^2\right )}-\frac {1}{144} (-31 d+50 e-76 f) \int \frac {1}{2+x} \, dx-\frac {1}{144} (-d-2 e-4 f) \int \frac {1}{-2+x} \, dx-\frac {1}{36} (d+e+f) \int \frac {1}{-1+x} \, dx-\frac {1}{36} (7 d-13 e+19 f) \int \frac {1}{1+x} \, dx\\ &=-\frac {5 d-6 e+8 f+(3 d-4 e+6 f) x}{12 \left (2+3 x+x^2\right )}-\frac {1}{36} (d+e+f) \log (1-x)+\frac {1}{144} (d+2 e+4 f) \log (2-x)-\frac {1}{36} (7 d-13 e+19 f) \log (1+x)+\frac {1}{144} (31 d-50 e+76 f) \log (2+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.07, size = 97, normalized size = 0.92 \[ \frac {1}{144} \left (-\frac {12 (d (3 x+5)-4 e x-6 e+6 f x+8 f)}{x^2+3 x+2}-4 \log (1-x) (d+e+f)+\log (2-x) (d+2 e+4 f)-4 \log (x+1) (7 d-13 e+19 f)+\log (x+2) (31 d-50 e+76 f)\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[((2 - 3*x + x^2)*(d + e*x + f*x^2))/(4 - 5*x^2 + x^4)^2,x]

[Out]

((-12*(-6*e + 8*f - 4*e*x + 6*f*x + d*(5 + 3*x)))/(2 + 3*x + x^2) - 4*(d + e + f)*Log[1 - x] + (d + 2*e + 4*f)
*Log[2 - x] - 4*(7*d - 13*e + 19*f)*Log[1 + x] + (31*d - 50*e + 76*f)*Log[2 + x])/144

________________________________________________________________________________________

fricas [B]  time = 0.88, size = 191, normalized size = 1.82 \[ -\frac {12 \, {\left (3 \, d - 4 \, e + 6 \, f\right )} x - {\left ({\left (31 \, d - 50 \, e + 76 \, f\right )} x^{2} + 3 \, {\left (31 \, d - 50 \, e + 76 \, f\right )} x + 62 \, d - 100 \, e + 152 \, f\right )} \log \left (x + 2\right ) + 4 \, {\left ({\left (7 \, d - 13 \, e + 19 \, f\right )} x^{2} + 3 \, {\left (7 \, d - 13 \, e + 19 \, f\right )} x + 14 \, d - 26 \, e + 38 \, f\right )} \log \left (x + 1\right ) + 4 \, {\left ({\left (d + e + f\right )} x^{2} + 3 \, {\left (d + e + f\right )} x + 2 \, d + 2 \, e + 2 \, f\right )} \log \left (x - 1\right ) - {\left ({\left (d + 2 \, e + 4 \, f\right )} x^{2} + 3 \, {\left (d + 2 \, e + 4 \, f\right )} x + 2 \, d + 4 \, e + 8 \, f\right )} \log \left (x - 2\right ) + 60 \, d - 72 \, e + 96 \, f}{144 \, {\left (x^{2} + 3 \, x + 2\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-3*x+2)*(f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x, algorithm="fricas")

[Out]

-1/144*(12*(3*d - 4*e + 6*f)*x - ((31*d - 50*e + 76*f)*x^2 + 3*(31*d - 50*e + 76*f)*x + 62*d - 100*e + 152*f)*
log(x + 2) + 4*((7*d - 13*e + 19*f)*x^2 + 3*(7*d - 13*e + 19*f)*x + 14*d - 26*e + 38*f)*log(x + 1) + 4*((d + e
 + f)*x^2 + 3*(d + e + f)*x + 2*d + 2*e + 2*f)*log(x - 1) - ((d + 2*e + 4*f)*x^2 + 3*(d + 2*e + 4*f)*x + 2*d +
 4*e + 8*f)*log(x - 2) + 60*d - 72*e + 96*f)/(x^2 + 3*x + 2)

________________________________________________________________________________________

giac [A]  time = 0.32, size = 101, normalized size = 0.96 \[ \frac {1}{144} \, {\left (31 \, d + 76 \, f - 50 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) - \frac {1}{36} \, {\left (7 \, d + 19 \, f - 13 \, e\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{36} \, {\left (d + f + e\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{144} \, {\left (d + 4 \, f + 2 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) - \frac {{\left (3 \, d + 6 \, f - 4 \, e\right )} x + 5 \, d + 8 \, f - 6 \, e}{12 \, {\left (x + 2\right )} {\left (x + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-3*x+2)*(f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x, algorithm="giac")

[Out]

1/144*(31*d + 76*f - 50*e)*log(abs(x + 2)) - 1/36*(7*d + 19*f - 13*e)*log(abs(x + 1)) - 1/36*(d + f + e)*log(a
bs(x - 1)) + 1/144*(d + 4*f + 2*e)*log(abs(x - 2)) - 1/12*((3*d + 6*f - 4*e)*x + 5*d + 8*f - 6*e)/((x + 2)*(x
+ 1))

________________________________________________________________________________________

maple [A]  time = 0.01, size = 134, normalized size = 1.28 \[ \frac {31 d \ln \left (x +2\right )}{144}+\frac {d \ln \left (x -2\right )}{144}-\frac {d \ln \left (x -1\right )}{36}-\frac {7 d \ln \left (x +1\right )}{36}-\frac {25 e \ln \left (x +2\right )}{72}+\frac {e \ln \left (x -2\right )}{72}-\frac {e \ln \left (x -1\right )}{36}+\frac {13 e \ln \left (x +1\right )}{36}+\frac {19 f \ln \left (x +2\right )}{36}+\frac {f \ln \left (x -2\right )}{36}-\frac {f \ln \left (x -1\right )}{36}-\frac {19 f \ln \left (x +1\right )}{36}-\frac {d}{6 \left (x +1\right )}-\frac {d}{12 \left (x +2\right )}+\frac {e}{6 x +6}+\frac {e}{6 x +12}-\frac {f}{6 \left (x +1\right )}-\frac {f}{3 \left (x +2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-3*x+2)*(f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x)

[Out]

1/144*d*ln(x-2)+1/72*e*ln(x-2)+1/36*f*ln(x-2)-7/36*d*ln(x+1)+13/36*e*ln(x+1)-19/36*f*ln(x+1)-1/6/(x+1)*d+1/6/(
x+1)*e-1/6/(x+1)*f-1/36*d*ln(x-1)-1/36*e*ln(x-1)-1/36*f*ln(x-1)-1/12/(x+2)*d+1/6/(x+2)*e-1/3/(x+2)*f+31/144*d*
ln(x+2)-25/72*e*ln(x+2)+19/36*f*ln(x+2)

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 91, normalized size = 0.87 \[ \frac {1}{144} \, {\left (31 \, d - 50 \, e + 76 \, f\right )} \log \left (x + 2\right ) - \frac {1}{36} \, {\left (7 \, d - 13 \, e + 19 \, f\right )} \log \left (x + 1\right ) - \frac {1}{36} \, {\left (d + e + f\right )} \log \left (x - 1\right ) + \frac {1}{144} \, {\left (d + 2 \, e + 4 \, f\right )} \log \left (x - 2\right ) - \frac {{\left (3 \, d - 4 \, e + 6 \, f\right )} x + 5 \, d - 6 \, e + 8 \, f}{12 \, {\left (x^{2} + 3 \, x + 2\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-3*x+2)*(f*x^2+e*x+d)/(x^4-5*x^2+4)^2,x, algorithm="maxima")

[Out]

1/144*(31*d - 50*e + 76*f)*log(x + 2) - 1/36*(7*d - 13*e + 19*f)*log(x + 1) - 1/36*(d + e + f)*log(x - 1) + 1/
144*(d + 2*e + 4*f)*log(x - 2) - 1/12*((3*d - 4*e + 6*f)*x + 5*d - 6*e + 8*f)/(x^2 + 3*x + 2)

________________________________________________________________________________________

mupad [B]  time = 0.83, size = 97, normalized size = 0.92 \[ \ln \left (x-2\right )\,\left (\frac {d}{144}+\frac {e}{72}+\frac {f}{36}\right )-\ln \left (x+1\right )\,\left (\frac {7\,d}{36}-\frac {13\,e}{36}+\frac {19\,f}{36}\right )-\ln \left (x-1\right )\,\left (\frac {d}{36}+\frac {e}{36}+\frac {f}{36}\right )+\ln \left (x+2\right )\,\left (\frac {31\,d}{144}-\frac {25\,e}{72}+\frac {19\,f}{36}\right )-\frac {\frac {5\,d}{12}-\frac {e}{2}+\frac {2\,f}{3}+x\,\left (\frac {d}{4}-\frac {e}{3}+\frac {f}{2}\right )}{x^2+3\,x+2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((x^2 - 3*x + 2)*(d + e*x + f*x^2))/(x^4 - 5*x^2 + 4)^2,x)

[Out]

log(x - 2)*(d/144 + e/72 + f/36) - log(x + 1)*((7*d)/36 - (13*e)/36 + (19*f)/36) - log(x - 1)*(d/36 + e/36 + f
/36) + log(x + 2)*((31*d)/144 - (25*e)/72 + (19*f)/36) - ((5*d)/12 - e/2 + (2*f)/3 + x*(d/4 - e/3 + f/2))/(3*x
 + x^2 + 2)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2-3*x+2)*(f*x**2+e*x+d)/(x**4-5*x**2+4)**2,x)

[Out]

Timed out

________________________________________________________________________________________